package org.hk.kg;

import java.util.HashMap;
import java.util.Map;

public class TraceObject {
	private String commandId;
	private String action;
	private Map params;
	private TraceObject prev,
		next;
	private boolean taceable = true;
	
	public TraceObject() {
		super();
	}
	
	public TraceObject(String commandId)
	{
		this();
		this.commandId = commandId;
	}
	
	public TraceObject(String commandId,boolean taceable)
	{
		this(commandId);
		this.taceable = taceable;
	}
	
	public TraceObject(String commandId,String action) {
		this();
		this.commandId = commandId;
		this.action = action;
	}
	
	public TraceObject(String commandId,String action, Map params) {
		this(commandId,action);
		this.params = params;
	}
	public String getCommandId() {
		return commandId;
	}
	public void setCommandId(String commandId) {
		this.commandId = commandId;
	}
	public Map getParams() {
		return params;
	}
	
	public void setParams(Map params) {
		this.params = params;
	}
	
	public void addParam(String key,Object value)
	{
		if(null == this.params)
		{
			setParams(new HashMap());
		}
		this.params.put(key, value);
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	public boolean isTaceable() {
		return taceable;
	}

	public void setTaceable(boolean taceable) {
		this.taceable = taceable;
	}

	public TraceObject getPrev() {
		return prev;
	}

	public void setPrev(TraceObject prev) {
		this.prev = prev;
	}

	public TraceObject getNext() {
		return next;
	}

	public void setNext(TraceObject next) {
		this.next = next;
	}
}
